<?php include_once('includes/header.php'); ?>
<?php include_once('includes/posts-header.php'); ?>
<?php include_once('scripts/session.php'); ?>
<?php include_once('scripts/get-categories.php'); ?>
		<script type="text/javascript" src="js/categories.js"></script>
		<div class="col-full">
			<form name="categories" action="categories.php" id="categories"></form>
				<div id="toolbar" class="floatright">
					<ul>
						<li><a href="#new" class="toolbar" id="new" onclick="new_category();"><span class="new"></span>New</a></li>
						<li><a href="#edit" class="toolbar" id="edit" onclick="edit_category();"><span class="edit"></span>Edit</a></li>
						<li><a href="#" class="toolbar" id="publish" onclick="update_cats_state(this);"><span class="publish"></span>Publish</a></li>
						<li><a href="#" class="toolbar" id="unpublish" onclick="update_cats_state(this);"><span class="unpublish"></span>Unpublish</a></li>
						<li><a href="#" class="toolbar" id="trash" onclick="update_cats_state(this);"><span class="trash"></span>Trash</a></li>
					</ul>
				</div><!-- End #toolbar-->
				<div id="error-message" class="<?php echo $mess_class; ?>"><?php echo $mess; ?></div>

				<div class="floatleft" id="leftsection" style="border: none;">
					<div id="postsmenu" class="data-menu">
						<ul>
							<li>
								<select name="cat_level" id="cat_level" onchange="change_conditions();">
									<option value="0">- Select max level -</option>
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
								</select>
							</li>
							<li>
								<select name="cat_state" id="cat_state" onchange="change_conditions();">
									<option value="0">- Select state -</option>
									<option value="1">Publish</option>
									<option value="2">Unpublish</option>
									<option value="3">Trash</option>
								</select>
							</li>
							<li>
								<select name="cat_author" id="cat_author" onchange="change_conditions();">
									<option value="all">- Select author -</option>
									<option value="admin">Admin</option>
								</select>
							</li>
						</ul>
					</div><!-- End #catsmenu-->
					<div id="viewcategories" class="data">
						<?php get_categories(1,10); ?>
					</div><!-- End #viewcategories-->
				</div><!--End #leftsection" -->
				<div id="rightsection" class="floatright">
					<h2 id="cat-header">Create new category</h2>
					<div class="form-elements">
						<label for="cat-name">Category name</label>
						<input type="text" name="cat-name" id="cat-name" />
					</div><!-- End .form-elements-->
					<div class="form-elements">
						<label for="description">Description</label>
						<textarea name="cat-description" id="cat-description"></textarea>
					</div><!-- End .form-elements-->
					<div class="form-elements">
						<label for="state">State</label>
						<select name="new_state" id="new_state">
							<option value="1">Publish</option>
							<option value="2">Unpublish</option>
							<option value="3">Trash</option>
						</select>
					</div><!-- End .form-elements-->
					<div class="form-elements">
						<label for="category">Parent</label>
						<?php create_categories_list("parentid"); ?>
					</div><!-- End .form-elements-->
					<div class="form-elements">
						<input type="button" id="submit" class="myButton" value="Add new" onclick="add_new_cat('2');" />
					</div><!-- End .form-elements-->
					<input type="hidden" name="cat_id" id="cat_id" value="0" />
				</div><!-- End #rightsection-->
		</div><!-- End .col-full-->
	</div><!-- End #mainWrapper-->
</body>
</html>
